﻿using System;
using System.Collections.Generic;
using System.Text;
using Tauren.Form.DLL.Base;
using Tauren.Form.DLL.Resouces;
using Tauren.Form.Entity.Config;
using Tauren.Form.Entity.Global;
using Tauren.Form.Entity.Input;
using Tauren.Form.Entity.Output;
using Tauren.Form.Infrastructure.Globals;

namespace Tauren.Form.Service.Form_TableInfoBLL
{
    public class Form_TableImImpService : Base.BaseService, IForm_TableInfoService
    {
        public Form_TableImImpService(IBaseDLL baseDLL, IConnectionBLLBase connectionBLL, IMenuResourcesBusiness resourcesBusiness = null) : base(baseDLL, connectionBLL, resourcesBusiness)
        {
        }

        public virtual double VersionName => 0;

        public virtual IResponseMessage Add(Form_TableInfo_InPut data)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage Childs(QueryModel queryModel)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage Config(string PageType)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage Delete(long AutoID)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage Edit(Form_TableInfo_InPut data)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage Enable(long AutoID)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage FirstOrDefault(long id)
        {
            throw new NotImplementedException();
        }

        public virtual IResponseMessage Pages(QueryModel queryModel)
        {
            throw new NotImplementedException();
        }
        #region private
        /// <summary>
        /// 组装外键字段
        /// </summary>
        /// <param name="o"></param>
        protected void SwitchFieldKey(PageForm_TableInfoTable o)
        {
            switch (o.ForeignKey.ToLower())
            {
                case "empid":
                    o.FieldName = "员工ID";
                    o.FieldENName = "EmpLoyee ID"; break;
                case "empcode":
                    o.FieldName = "员工编码";
                    o.FieldENName = "Employee Code"; break;
                case "orgid":
                    o.FieldName = "组织ID";
                    o.FieldENName = "Organization ID"; break;
                case "orgcode":
                    o.FieldName = "组织编码";
                    o.FieldENName = "Organization code"; break;
                case "positionId":
                    o.FieldName = "职位ID";
                    o.FieldENName = "Position ID"; break;
                case "positioncode":
                    o.FieldName = "职位编码";
                    o.FieldENName = "Position Code"; break;
                default:
                    o.FieldName = "主键";
                    o.FieldENName = "Primary key";
                    break;
            }
        }
        #endregion
    }
}
